package com.yzs.exam.listener;

import com.yzs.exam.entity.User;
import com.yzs.exam.event.OnRegistrationCompleteEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * OnRegistrationCompleteEvent -- 注册成功监听器
 * @author yzs
 * @create 2021-03-22 13:31
 */
@Component
public class EmailSendListener implements ApplicationListener<OnRegistrationCompleteEvent> {


    @Override
    public void onApplicationEvent(OnRegistrationCompleteEvent event) {
        User user = event.getUser();
        System.out.println("User register Email sender :" + user.getUserName());
        //邮箱发送处理...
    }
}
